package com.xiangyueEducation.uploaderCloud.utils.enums;


/**
 * 统一返回结果状态信息类
 *
 */
public enum ResultCodeEnum {

    //IO操作失败以1开头
    IO_ERROR(100,"IO_ERROR"),
    FILE_DELETE_ERROR(101,"fileDeleteError"),
    FILE_MAKE_ERROR(102,"fileMakeError"),
    FILE_WRITE_ERROR(103,"fileWriteError"),
    FILE_READ_ERROR(104,"fileReadError"),
    FILE_NAME_TOO_LONG(105,"fileNameTooLong"),
    FiLE_NAME_EXISTS(106,"fileNameExists"),

    SUCCESS(200,"success"),


    //数据库查询错误以2开头
    DB_QUERY_FAIL(201,"queryFail"),
    DB_PAGE_OVERFLOW(202,"pageOverflow"),
    DB_QUERY_EMPTY(203,"queryButGotNothing"),
    DB_QUERY_HAVE_SAME(204,"haveNotAllowedSame"),
    DB_INSERT_FAIL(205,"writeFail"),
    DB_DELETE_FAIL(206,"deleteFail"),
    DB_UPDATE_FAIL(207,"updateFail"),

    SERVER_ERROR(500,"serverError"),

    USERNAME_ERROR(501,"usernameError"),
    PASSWORD_ERROR(502,"passwordError"),

    NOT_LOGIN(503,"notLogin"),
    ID_USED(504,"identityUsed"),
    REQUEST_FAIL(505,"requestFail"),
    USER_STOP(506,"userSTOP"),//账户被停用,所有服务不可用
    USER_LOGIN_LOCK(507,"userLoginLock"),//账户被禁止登录
    PROXY_USER_ERROR(508,"proxyUserError"),//代理用户错误
    SESSION_USER_EXISTS(509,"sessionUserExists"),//临时用户存在
    SESSION_USER_NOT_EXISTS(510,"sessionUserNotExists"),//临时用户不存在
    SESSION_USER_MAKE_ERROR(511,"sessionUserMakeError"),//临时用户创建错误
    USERNAME_OR_PASSWORD_ERROR(512,"usernameOrPasswordError"),
    USERNAME_USED(513,"usernameUsed"),
    TEST_ID_ERROR(514,"testIdError"),//测试题id错误
    INVALID_QUESTION_ARE_ENABLED(515, "invalidQuestionAreEnabled"),
    QUESTION_VAL_NOT_MATCH(516,"questionValNotMatch" ),
    FORMAT_VALUE_ERROR(517,"formatValueError"),
    FORMAT_OPTION_ERROR(518, "formatOptionError"),
    QUESTION_LENGTH_ERROR(519,"questionLengthError"),
    NOT_FILE(520,"notFile" ),
    PAGE_PARAMETER_SIEZ_ERROR(521,"pageParameterSizeError"),
    USER_ROLE_ERROR(522,"userRoleError"),
    QUESTION_NUMBER_SEQUENCE_ERROR(523,"questionNumberSequenceError"),
    MUST_HAVE_ID(524, "mustHaveId"),
    ONLY_CAN_UPDATE_YOURSELF(525,"onlyCanUpdateYourselfInformation"),
    APPOINTMENT_TIME_MUST_AFTER_NOW(526, "appointmentTimeMustAfterNow"),
    DOCTOR_NOT_EXIST(527, "doctorNotExist"),
    FeedbackIsBlank(528, "feedbackCanNotBeBlank"),
    AdviceIsBlank(529,"AdviceCanNotBeBlank"),

    //fileGroup的CodeEnum(以3开头)
    FILE_GROUP_TITLE_EXISTS_ERROR(301,"fileGroupTitleExistsError"),

    //危险操作4开头,444为最高级别危险
    SEVERE_HANDLER(444,"severeHandler(A Delete_action Maybe Invoked by A Stranger)"),

    //参数不合理错误等5开头
    PROMPT_ILLEGAL(800,"promptIllegal"),
    PROMPT_TOO_LONG(801,"promptTooLong"),
    PROMPT_IS_NULL(802,"promptIsNull"),
    PROMPT_OUT_OF_RANGE(803,"promptOutOfRange"),
    PROMPT_NOT_EXIST(804,"promptNotExist"),
    PROMPT_CLASS_IS_ILLEGAL(805,"promptClassIsIllegal"),



    //管理员以6开头
    ADMIN_LIMITED_AUTHORITY(601,"adminLimitedAuthority"),
    ADMIN_BAND(602,"adminBand"),

    //其他错误以7开头
    CAPTCHA_REQUEST_REPEAT(700,"captchaRequestRepeat"),
    CAPTCHA_EXPIRED(701,"captchaExpired"),
    CAPTCHA_ERROR(702,"captchaError"),
    DONT_REPEAT_REQUEST(703,"dontRepeatRequest"),

    //服务问题以8开头
    SERVICE_NOT_FOUND(802,"serviceNotFound");


    private Integer code;
    private String message;
    private ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    public Integer getCode() {
        return code;
    }
    public String getMessage() {
        return message;
    }
}
